<html>
<head>
<meta charset="UTF-8">
<title>KBEngine - KBEngine client ÎÄµµ</title>
<link href="../../style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td align=left style="background:#708090"> <font size=15 color=#ffffff> KBEngine </font></td></tr>
</table> <hr>
<h1>KBEngine module</h1>
This <a href="KBEngine.html">KBEngine</a> module provides a part of the 
logic script layer access to <a href="../Classes/Entity.html">entity</a>, 
as well as current space data and so on.
<h2><a href="#" onClick="obj=document.getElementById( 'classes' );vis = (obj.style.display == 'none') ? 'block' : 'none'; obj.style.display = vis; return false;" class="h2">Class</a></h2>
<table id="classes" cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr><td>
<span class="class_list"><a href="../Classes/Entity.html" class="class_list" >Entity</a></span>
</td></tr>

</table>

<h2><a href="#" onClick="obj=document.getElementById( 'functions' );vis = (obj.style.display == 'none') ? 'block' : 'none'; obj.style.display = vis; return false;" class="h2">Member function</a></h2>
<table id="functions" cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr><td>
<span class="function_list">def <a href="#login" class="function_list" >login</a>( username, password ):</span>
</td></tr>

<tr><td>
<span class="function_list">def <a href="#createAccount" class="function_list" >createAccount</a>( username, password ):</span>
</td></tr>

<tr><td>
<span class="function_list">def <a href="#reloginBaseapp" class="function_list" >reloginBaseapp</a>():</span>
</td></tr>

<tr><td>
<span class="function_list">def <a href="#player" class="function_list" >player</a>(  ):</span>
</td></tr>

<tr><td>
<span class="function_list">def <a href="#resetPassword" class="function_list" >resetPassword</a>(username):</span>
</td></tr>

<tr><td>
<span class="function_list">def <a href="#bindAccountEmail" class="function_list" >bindAccountEmail</a>( emailaddress ):</span>
</td></tr>

<tr><td>
<span class="function_list">def <a href="#newPassword" class="function_list" >newPassword</a>( oldpassword, newpassword ):</span>
</td></tr>

<tr><td>
<span class="function_list">def <a href="#findEntity" class="function_list" >findEntity</a>( entityID ):</span>
</td></tr>

<tr><td>
<span class="function_list">def <a href="#getSpaceData" class="function_list" >getSpaceData</a>( key ):</span>
</td></tr>

</table>

<h2><a href="#" onClick="obj=document.getElementById( 'callbacks' );vis = (obj.style.display == 'none') ? 'block' : 'none'; obj.style.display = vis; return false;" class="h2">Callback</a></h2>
<table id="callbacks" cellpadding=0 cellspacing=3 style="margin-left: 20px;">

</table>

<h2><a href="#" onClick="obj=document.getElementById( 'attributes' );vis = (obj.style.display == 'none') ? 'block' : 'none'; obj.style.display = vis; return false;" class="h2">Attributes</a></h2>
<table id="attributes" cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr valign=top><td><a href="#component" class="attribute_list" >component</a></td><td>&nbsp; Read only <a href="STRING.html">string</a></td></tr>

<tr valign=top><td><a href="#entities" class="attribute_list" >entities</a></td><td>&nbsp; <a href="Entities.html">Entities</a>

<tr valign=top><td><a href="#entity_uuid" class="attribute_list" >entity_uuid</a></td><td>&nbsp; uint64

<tr valign=top><td><a href="#entity_id" class="attribute_list" >entity_id</a></td><td>&nbsp; int32

<tr valign=top><td><a href="#spaceID" class="attribute_list" >spaceID</a></td><td>&nbsp; int32

</td></tr>

</table>

<hr>
<h2>Member functions documentation</h2>

<a name="login"></a><p class="function_definition">
<span class="function_definition">def login( <i>username, password </i> ):</span>
</p>

<div class="function_description">
<b>Function description:</b><br><br>
Login account to KBEngine server.<br>
Note: If the plug-in and the UI layer use event interaction mode, do 
not call directly from the UI layer. Please trigger a "login" event to the 
plug-in. The event is accompanied by the data username and password.
<br>
</div>

<p>
<span class="function_parameter">parameter</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr valign=top><td><span class="function_parameter_name"><i>username</i></span></td><td><span class="function_parameter_description">
string, username.
</span></td></tr>

<tr valign=top><td><span class="function_parameter_name"><i>password</i></span></td><td><span class="function_parameter_description">
string, password.
</span></td></tr>
</table>
</p>



<a name="createAccount"></a><p class="function_definition">
<span class="function_definition">def createAccount( <i>username, password </i> ):</span>
</p>

<div class="function_description">
<b>Function description</b><br><br>
Request to create a login account on the KBEngine server.
<br>
Note: If the plug-in and the UI layer use the event interaction mode, 
do not call directly from the UI layer. Please trigger a "createAccount" 
event to the plug-in. The event is accompanied by the data username and 
password.
<br>
</div>

<p>
<span class="function_parameter">parameters:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr valign=top><td><span class="function_parameter_name"><i>username</i></span></td><td><span class="function_parameter_description">
string, username.
</span></td></tr>

<tr valign=top><td><span class="function_parameter_name"><i>password</i></span></td><td><span class="function_parameter_description">
string, password.
</span></td></tr>
</table>
</p>



<a name="reloginBaseapp"></a><p class="function_definition">
<span class="function_definition">def reloginBaseapp( <i> </i> ):</span>
</p>

<div class="function_description">
<b>Function description</b><br><br>
Requests to re-login to the KBEngine server (usually used after a dropped 
connection in order to connect to the server more quickly and continue to 
control the server role).<br>
Note: If the plug-in and the UI layer use event interaction mode, do 
not call directly from the UI layer, please trigger a "reloginBaseapp" 
event to the plug-in, and the incidental data is empty.
<br>
</div>



<a name="player"></a><p class="function_definition">
<span class="function_definition">def player( <i></i> ):</span>
</p>

<div class="function_description">
<b>Function description</b><br><br>
Gets the entity that the current client controls.<br>
<br>
</div>

<p>
<span class="function_return">return:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">
<tr><td>
<a href=../../keywords.html#entity>Entity</a>, return controlled entity, 
if it does not exist (e.g.: failed to connect to the server) returns null.
</td></tr>
</table>
</p>




<a name="resetPassword"></a><p class="function_definition">
<span class="function_definition">def resetPassword( <i>username</i> ):</span>
</p>

<div class="function_description">
<b>Function description</b><br><br>
Asks loginapp to reset the password of the account. The server will send 
a password reset email (usually the forgotten password function) to the 
email address to which the account is bound.<br>
<br>
</div>

<p>
<span class="function_parameter">parameters:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr valign=top><td><span class="function_parameter_name"><i>username</i></span></td><td><span class="function_parameter_description">
string, username.
</span></td></tr>
</table>
</p>



<a name="bindAccountEmail"></a><p class="function_definition">
<span class="function_definition">def bindAccountEmail( <i>emailaddress</i> ):</span>
</p>

<div class="function_description">
<b>Function description</b><br><br>
Requests Baseapp to bind the email address of the account.<br>
<br>
</div>

<p>
<span class="function_parameter">parameters:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr valign=top><td><span class="function_parameter_name"><i>emailaddress</i></span></td><td><span class="function_parameter_description">
string, email address.
</span></td></tr>
</table>
</p>



<a name="newPassword"></a><p class="function_definition">
<span class="function_definition">def newPassword( <i>oldpassword, newpassword</i> ):</span>
</p>

<div class="function_description">
<b>Function description</b><br><br>
Requests to set a new password for the account.<br>
<br>
</div>

<p>
<span class="function_parameter">parameters:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr valign=top><td><span class="function_parameter_name"><i>oldpassword</i></span></td><td><span class="function_parameter_description">
string, old password
</span></td></tr>
<tr valign=top><td><span class="function_parameter_name"><i>newpassword</i></span></td><td><span class="function_parameter_description">
string, new password
</span></td></tr>
</table>
</p>



<a name="findEntity"></a><p class="function_definition">
<span class="function_definition">def findEntity( <i>entityID </i> ):</span>
</p>

<div class="function_description">
<b>Function description</b><br><br>
Finds an instance object of an entity by its ID.
</div>

<p>
<span class="function_parameter">parameters:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr valign=top><td><span class="function_parameter_name"><i>entityID</i></span></td><td><span class="function_parameter_description">
int32, entity ID.
</span></td></tr>
</table>
</p>

<p>
<span class="function_return">returns:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">
<tr><td>
<a href=../../keywords.html#entity>Entity</a> An entity instance is returned.
There can be no return null.
</td></tr>
</table>
</p>



<a name="getSpaceData"></a><p class="function_definition">
<span class="function_definition">def getSpaceData( <i>key </i> ):</span>
</p>

<div class="function_description">
<b>Function description</b><br><br>
Gets the space data for the specified key.
<br>
The space data is set by the user on the server through 
<a href=../../cellapp/Modules/KBEngine.html#setSpaceData>setSpaceData</a>.
</div>

<p>
<span class="function_parameter">parameters:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">

<tr valign=top><td><span class="function_parameter_name"><i>key</i></span></td><td><span class="function_parameter_description">
string, a keyword
</span></td></tr>
</table>
</p>

<p>
<span class="function_return">returns:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">
<tr><td>
string, specifies the value at the key
</td></tr>
</table>
</p>

<hr>
<h2>Callback function documentation</h2>
</table>
</p>

</table>
</p>


<hr>
<h2>Attributes documentation</h2>

<a name="component"></a><p class="attribute_definition">
<span class="attribute_definition">component</span>
</p>

<div class="attribute_description">
<b>Description:</b><br><br>
This is the component that is running in the current scripting environment. 
(So far) Possible values are 'cellapp', 'baseapp', 'client', 'dbmgr', 'bots' 
and 'editor'.
</div>

<a name="entities"></a><p class="attribute_definition">
<span class="attribute_definition">entities</span>
</p>

<div class="attribute_description">
<b>Description:</b><br><br>
entities is a dictionary object that contains all the entities in the current process.
</div>

<p>
<span class="attribute_type">Types:</span>
<table border=0 cellpadding=0 cellspacing=3 style="margin-left: 20px;">
<tr><td><a href="../Classes/Entity.html">Entities</a>
</td></tr>
</table>
</p>

<a name="entity_uuid"></a><p class="attribute_definition">
<span class="attribute_definition">entity_uuid</span>
</p>

<div class="attribute_description">
<b>Description:</b><br><br>
The uuid of the entity. Change the ID and entity to bind to this login. 
When using the heavy login function, the server compares this ID and 
determines the validity.
</div>


<a name="entity_id"></a><p class="attribute_definition">
<span class="attribute_definition">entity_id</span>
</p>

<div class="attribute_description">
<b>Description:</b><br><br>
The ID of the entity controlled by the current client.
</div>


<a name="spaceID"></a><p class="attribute_definition">
<span class="attribute_definition">spaceID</span>
</p>

<div class="attribute_description">
<b>Description:</b><br><br>
The ID of the <a href=../../keywords.html#Space>Space</a> where the 
entity controlled by the current client is located (also can be understood 
as the corresponding scene, room, and copy).
</div>


<hr>
<p class="copyrightFooter">Copyright KBEngine</p>
</body>
</html>
